Skip to main content

FuroStreamRouter

FuroStreamRouter contract is the contract that is directly used to create and update token streams, complete with full deposit / withdraw functionality - all on BentoBox.

The full contract can be found here.

State-Changing Functions

createStream

function createStream(
address recipient,
address token,
uint64 startTime,
uint64 endTime,
uint256 amount,
bool fromBentoBox,
uint256 minShare
) external payable returns (uint256 streamId, uint256 depositedShares);

Creates a new stream.

  • msg.sender should have already given the router an allowance of at least the amount on the token.
  • startTime and endTime define the duration of the stream.
  • minShare sets a lower limit for the deposited shares.

Parameters

NameTypeDescription
recipientaddressAddress of the recipient of the stream.
tokenaddressAddress of the token to be streamed.
startTimeuint64UNIX timestamp for when the stream should start.
endTimeuint64UNIX timestamp for when the stream should end.
amountuint256Amount of tokens to be streamed.
fromBentoBoxboolIf true, the tokens will be taken from the caller's BentoBox balance.
minShareuint256The minimum amount of shares to be deposited. If not met, the function reverts.

Returns

NameTypeDescription
streamIduint256ID of the created stream.
depositedSharesuint256Amount of shares deposited into the stream.

Reverts

This function reverts if the depositedShares is less than minShare.

Events

No events are directly emitted from this function. However, it calls createStream function in furoStream contract, which might emit events.